import request from '@/utils/request'

const api = '/admin/order'

export default {
  recharge (rechargeVo) {
    return request({
      url: `/api/order/rechargeOrder/auth/recharge`,
      method: 'post',
      data: rechargeVo
    })
  },
  getRechargeActivityInfo () {
    return request({
      url: `/api/order/rechargeOrder/getRechargeActivityInfo`
    })
  },
  getRechargeOrderPageList (parameter, queryParam) {
    return request({
      url: `${api}/rechargeOrder/${parameter.pageNo}/${parameter.pageSize}`,
      method: 'post',
      data: queryParam
    })
  },
  showRechargeOrder (id) {
    return request({
      url: `${api}/rechargeOrder/show/${id}`,
      method: 'get'
    })
  },
  editRechargeOrder (rechargeOrder) {
    return request({
      url: `${api}/rechargeOrder/update`,
      method: 'post',
      data: rechargeOrder
    })
  },
  removeRechargeOrderInfo (id) {
    return request({
      url: `${api}/rechargeOrder/${id}`,
      method: 'delete'
    })
  },
  consume (consumeVo) {
    return request({
      url: `/api/order/consumeOrder/auth/consume`,
      method: 'post',
      data: consumeVo
    })
  },
  getConsumeOrderPageList (parameter, queryParam) {
    return request({
      url: `${api}/consumeOrder/${parameter.pageNo}/${parameter.pageSize}`,
      method: 'post',
      data: queryParam
    })
  },
  showConsumeOrder (id) {
    return request({
      url: `${api}/consumeOrder/show/${id}`,
      method: 'get'
    })
  },
  editConsumeOrder (consumeOrder) {
    return request({
      url: `${api}/consumeOrder/update`,
      method: 'post',
      data: consumeOrder
    })
  },
  removeConsumeOrderInfo (id) {
    return request({
      url: `${api}/consumeOrder/${id}`,
      method: 'delete'
    })
  },
  getDiscount () {
    return request({
      url: `/api/order/consumeOrder/getDiscount`,
      method: 'get'
    })
  }
}
